export const useCancelReasonAndConfigStore = defineStore(
  'cancelReasonAndConfig',
  () => {
    const cancelReasonAndConfigData = ref<{
      cannle_reason: CancelReason[] // 取消原因
      reserve_project: ReserveProject[] // 就诊预约项目
    } | null>(null)

    const setCancelReasonAndConfigData = (newVal: {
      cannle_reason: CancelReason[] // 取消原因
      reserve_project: ReserveProject[] // 就诊预约项目
    } | null) => {
      cancelReasonAndConfigData.value = newVal
    }

    const $reset = () => setCancelReasonAndConfigData(null)

    return { cancelReasonAndConfigData, setCancelReasonAndConfigData, $reset }
  },
  {
    persist: { enabled: true },
  },
)
